package myjava.io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.io.Serializable;

/**
 * @author Yancy
 * @program springioctest
 * @create 2020-11-19
 */
public class ObjectRecow implements Serializable {

  public static void main(String[] args) {
    //

    FileInputStream fs = null;
    try {
      fs = new FileInputStream("myFile.text");
      ObjectInputStream ois = new ObjectInputStream(fs);

      Student student = (Student) ois.readObject();
      System.out.println(student);
      ois.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}
